<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>主页</title>
  <script src="./jquery3.6.0.js"></script>
  <link href="css/common.css" rel="stylesheet" />
  <link href="layui/css/layui.css" rel="stylesheet" />
  <link href="css/index.css" rel="stylesheet" />

  <!-- 引入 layui.js -->
  <script src="layui/layui.js"></script>
</head>

<body style="width: 1200px; margin: 0 auto;">
  <div class="layui-header header header-demo" autumn="" id="title">
    我的学习笔记
  </div>
  <div class="main">
    <div class="content"></div>
    <ul class="layui-nav layui-nav-tree layui-inline" lay-filter="demo" style="margin-right: 10px; height: 100%;">
      <li class="layui-nav-item layui-nav-itemed">
        <a href="javascript:;">默认展开</a>
        <dl class="layui-nav-child">
          <dd><a href="javascript:;">选项一</a></dd>
          <dd><a href="javascript:;">选项二</a></dd>
          <dd><a href="javascript:;">选项三</a></dd>
          <dd><a href="">跳转项</a></dd>
        </dl>
      </li>
      <li class="layui-nav-item">
        <a href="javascript:;">默认不展开</a>
        <dl class="layui-nav-child">
          <dd><a href="javascript:;">选项一</a></dd>
          <dd><a href="javascript:;">选项二</a></dd>
          <dd><a href="javascript:;">选项三</a></dd>
          <dd><a href="">跳转项</a></dd>
        </dl>
      </li>
    </ul>
  </div>


  <script>
    layui.use('element', function () {
      var element = layui.element; //导航的hover效果、二级菜单等功能，需要依赖element模块

      //导航点击事件
      element.on('nav(demo)', function (elem) {
        //console.log(elem)
        //layer.msg(elem.text());
        $("#title").text(elem.text());
      });
    });

    for(let i = 0; i < 1000; i++){
      let c =  $(".content").text();
      $(".content").text(c +"内容")
    }
    
  </script>
</body>

</html>